import { Entity, Column, PrimaryGeneratedColumn, OneToMany, CreateDateColumn, UpdateDateColumn } from 'typeorm';
import { ReplyForm } from './replyform.entity';

@Entity()
export class AskForm {
    @PrimaryGeneratedColumn()
    id: number;

    @Column()
    submitter: string;

    @Column()
    submitterUserId: string;

    @Column()
    company: string;

    @Column()
    department: string;

    @Column()
    position: string;

    @Column()
    isInternalAuditor: boolean;

    @Column('text')
    question: string;

    @Column({ default: false })
    isAnswered: boolean;

    @OneToMany(() => ReplyForm, replyForm => replyForm.askForm)
    replies: ReplyForm[];

    @CreateDateColumn()
    createdAt: Date;

    @UpdateDateColumn()
    updatedAt: Date;
} 